<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>市场情绪</title>
		<link href="css/text.css" rel="stylesheet" type="text/css" />
		<style type="text/css">
			.fixedBox{
				border: 5px solid #555555;				
				
			}
			.fixedBox::-webkit-scrollbar {
				width: 10px;     
				height: 10px;				
			}			
			
			ul{
				margin-top: 20px;
			}
			
			p{
				margin-top: -10px;
			}
			
			#f7{
				margin-left: -10px;
				color: #FFD700;		<!-- 标题颜色-->
			}
			
			#f8{
				margin-left: -10px;
				color: #FFA500;		<!-- 标题颜色-->
			}
			
			#f9{
				margin-left: -10px;
				color: #FFFF00;		<!-- 标题颜色-->
			}
			
			#f10{
				margin-left: -5px;
				color: #ADFF2F;		<!-- 标题颜色-->
			}
						
			#f11{
				color: #FFFAFA;		<!-- 详情颜色-->
			}
			
			#f12{
				margin-left: 10px;
				color: #7FFFD4;		
			}
			
		</style>		
		<script type="text/javascript" src="js/json2html.js"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="DatePicker/WdatePicker.js"> </script>
		<script type="text/javascript" src="js/echarts.js"></script>
	</head>
	<body>
		<div id="towrite" class="fixedBox"></div>
				
		<script>
			var dt = "";
			var tt = "";
			var gt = "";
			var k = "0";
			window.onload = function() {
				var day = new Date();
				gt = day.getTime();			
				mymonth = day.getMonth()+1;
				myday = day.getDate();
				if(mymonth >= 10){mymonth = mymonth;}else{mymonth = "0" + mymonth;}
				if(myday >= 10){myday = myday;}else{myday = "0" + myday;}
				tt = day.getFullYear() + "-" + mymonth + "-" + myday;	
				dt = tt;
				getSource();
				changeStyle();			
			}		

			function time_range(beginTime, endTime) {
				var strb = beginTime.split(":");
				if (strb.length != 2) {
					return false;
				}

				var stre = endTime.split(":");
				if (stre.length != 2) {
					return false;
				}

				var b = new Date();
				var e = new Date();
				var n = new Date();

				b.setHours(strb[0]);
				b.setMinutes(strb[1]);
				e.setHours(stre[0]);
				e.setMinutes(stre[1]);

				if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
					getSource();					
					console.log(true)　　　　　　
					return true;				
				} else {
					console.log(false)
				    return false;     
				}
			}　　　
   　　　
			$(function() {
				setInterval(function() {
				time_range("9:00","15:15")						
				},
				60000);
			})
			
			function changeStyle() {
				var div = document.getElementById("towrite");				
				div.style.left= "0px"; 				
				div.style.width= "90%";	
				//obj1.style.height= "360px";		
				div.style.fontSize="12px";	
			
			}
			
			Date.prototype.Format = function (fmt) {
				var o = {
				"M+": this.getMonth() + 1, //月份
				"d+": this.getDate(), //日
				"h+": this.getHours(), //小时
				"m+": this.getMinutes(), //分
				"s+": this.getSeconds(), //秒
				"q+": Math.floor((this.getMonth() + 3) / 3), //季度
				"S": this.getMilliseconds() //毫秒
				};
				if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
				for (var k in o)
				if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
				return fmt;
			};
			
			function getLocalTime(nS) {			          
				return new Date(parseInt(nS) * 1000).Format("hh:mm:ss")
			}
						
			function keepTwoDecimal(num) {  
               var result = parseFloat(num);  
               if (isNaN(result)) {                     
                   return false;  
               }  
               result = Math.round(num * 100) / 100;  
               return result;  
			}		
			
			function NumberTrans(num) { 
				var result = num;               
			    result = num/10000;
				result = result.toFixed(0) + '亿';			   				  
               return result;  
			};
			
			function cDayFunc(dp){ 
				var date = dp.cal.getNewDateStr();            
				BookingRmk(date);//调用其它函数并带上参数                
			}
			
			function BookingRmk(date){         				
				tt = date;
				var date1 = new Date(tt);
				var date2 = new Date(dt);							
				k = 0;
				if(date1.getTime() < date2.getTime()){			
					k = 1;
					tradeday();
				}			
				getSource();
			}			
			
			function prev(){  //前一天
				pn = -1;
				var day = new Date(tt);	
				day.setTime(day.getTime() - 24*60*60*1000);	
				tt = day.Format("yyyy-MM-dd");
				BookingRmk(tt);
			}
			
			function next(){  //后一天 				
				pn = 1;
				var day = new Date(tt);	
				day.setTime(day.getTime() + 24*60*60*1000);	
				tt = day.Format("yyyy-MM-dd");
				BookingRmk(tt);			
			}
			
			var pn = -1;
			function tradeday() {  //判断最后交易日
				var day = new Date(tt);							
				for (i = 1; i < 100; i++){	//节假日																										
					if(i > 1){
						day.setTime(day.getTime() + pn*24*60*60*1000);							
					}	
					tt = day.Format("yyyy-MM-dd");
					//alert(tt + dt);
					if(tt == dt){	
						k = 0;
						//getSource();
						break;
					}
					var url = "https://apphis.longhuvip.com/w1/api/index.php?Order=1&a=RealRankingInfo&st=30&apiv=w26&Type=1&c=ZhiShuRanking&PhoneOSNew=1&ZSType=7&Date=" + tt; 			
					
					var res = [];
					$.ajax({
						type: "get",
						url: url,
						dataType: "text",
						async : false,
						cache:false,
						timeout:3000,						
						success: function(data) {
							//alert(data)
							//alert(JSON.stringify(data))
							if(data.indexOf("MYSQL数据库链接出错!") == -1 && data.indexOf('"list":[]') == -1 && data.indexOf('"errcode":1020') == -1){
								var arr = JSON.parse(data);
								res = arr.list;								
							}else{
								res.push("");
							}							
						}
					});
					if(res[0].length != 0){						
						break;
					}
				}
			}
			
			var vol = "";
			
			function getSource() {
				div = document.getElementById('towrite');
				var myDate = new Date();
				//var time = '<p>' + myDate.Format("hh:mm:ss") +'</p>';					
				div.innerHTML = '<font size="3" style="color:#00FFFF;">市场情绪&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><input style="width: 90px; height:15px;" type="text" id="PriceDate" name="PriceDate" class="Wdate" onFocus="WdatePicker({ onpicking: cDayFunc})" />';		
				var back = '<a href="javascript:prev();"  style="padding-left:10px;font-size:16px;color:#fff;">←</a>';				
				var forward = '<a href="javascript:next();"  style="font-size:16px;color:#fff;">→</a>';
				div.innerHTML += back + forward;
				<!-- var url1 = "https://apphq.longhuvip.com/w1/api/index.php?a=DiskReview&apiv=w21&c=HomeDingPan&PhoneOSNew=1"; 				 -->
				<!-- var url2 = "https://apphq.longhuvip.com/w1/api/index.php?a=ZhangFuDetail&apiv=w21&c=HomeDingPan&PhoneOSNew=1"; 				 -->
				<!-- var url3 = "https://apphq.longhuvip.com/w1/api/index.php?a=ZhangTingExpression&apiv=w21&c=HomeDingPan&PhoneOSNew=1"; 	 -->
				
				
				//盘面点评
				var url11 = "https://apphq.longhuvip.com/w1/api/index.php?a=DiskReview&apiv=w30&c=HomeDingPan"; 
				var url12 = "https://apphis.longhuvip.com/w1/api/index.php?a=DiskReview&apiv=w30&c=HisHomeDingPan&Day=" + tt;
				
				//涨跌统计				
				var url21 = "https://apphq.longhuvip.com/w1/api/index.php?a=ZhangFuDetail&apiv=w21&c=HomeDingPan"; 
				var url22 = "https://apphis.longhuvip.com/w1/api/index.php?a=HisZhangFuDetail&c=HisHomeDingPan&apiv=w27&Day=" + tt; 
				
				//涨停表现
				var url31 = "https://apphq.longhuvip.com/w1/api/index.php?a=ZhangTingExpression&apiv=w30&c=HomeDingPan"; 
				var url32 = "https://apphis.longhuvip.com/w1/api/index.php?a=ZhangTingExpression&apiv=w30&c=HisHomeDingPan&Day=" + tt;
				
				//折线图
				var url41 = "https://apphq.longhuvip.com/w1/api/index.php?a=ChangeStatistics&apiv=w31&c=HomeDingPan"; 
				var url42 = "https://apphis.longhuvip.com/w1/api/index.php?st=60&a=ChangeStatistics&apiv=w31&c=HisHomeDingPan"; 
				
				//量能
				var url51 = "https://apphq.longhuvip.com/w1/api/index.php?a=MarketCapacity&apiv=w31&Type=0&c=HomeDingPan";
				var url52 = "https://apphis.longhuvip.com/w1/api/index.php?a=MarketCapacity&apiv=w31&Type=0&c=HisHomeDingPan&Date=" + tt;
				
				//量能柱
				var url6 = "https://apphis.longhuvip.com/w1/api/index.php?a=MarketCapacityKLine&apiv=w31&Type=0&c=HisHomeDingPan";
				
				//北向资金
				var url71 = "https://apphq.longhuvip.com/w1/api/index.php?a=NorthboundFundsB&apiv=w31&c=HomeDingPan";
				var url72 = "https://apphis.longhuvip.com/w1/api/index.php?a=NorthboundFundsB&apiv=w31&c=HisHomeDingPan&Day=" + tt;
				
				var url1 = url11;
				var url2 = url21;
				var url3 = url31;
				var url5 = url51;
				var url7 = url71;
				if(k == 1){
					var url1 = url12;
					var url2 = url22;
					var url3 = url32;
					var url5 = url52;
					var url7 = url72;
				}	
				
				
				var res1 = "";
				$.ajax({
					type: "get",
					url: url1,
					dataType: "text",
					async : false,
					cache:false,
					timeout:3000,						
					success: function(data) {
						//alert(data)
						//alert(JSON.stringify(data))
						res1 = data;				
					}
				});
				
				var res2 = "";
				$.ajax({
					type: "get",
					url: url2,
					dataType: "text",
					async : false,
					cache:false,
					timeout:3000,						
					success: function(data) {
						//alert(data)
						//alert(JSON.stringify(data))
						res2 = data;				
					}
				});
				
				var res3 = "";
				$.ajax({
					type: "get",
					url: url3,
					dataType: "text",
					async : false,
					cache:false,
					timeout:3000,						
					success: function(data) {
						//alert(data)
						//alert(JSON.stringify(data))
						res3 = data;				
					}
				});
				
				var res41 = "";
				$.ajax({
					type: "get",
					url: url41,
					dataType: "text",
					async : false,
					cache:false,
					timeout:3000,						
					success: function(data) {
						//alert(data)
						//alert(JSON.stringify(data))
						res41 = data;				
					}
				});
				
				var res42 = "";
				$.ajax({
					type: "get",
					url: url42,
					dataType: "text",
					async : false,
					cache:false,
					timeout:3000,						
					success: function(data) {
						//alert(data)
						//alert(JSON.stringify(data))
						res42 = data;				
					}
				});
				
				var res5 = "";
				$.ajax({
					type: "get",
					url: url5,
					dataType: "text",
					async : false,
					cache:false,
					timeout:3000,						
					success: function(data) {
						//alert(data)
						//alert(JSON.stringify(data))
						res5 = data;				
					}
				});
				
				var res6 = "";
				$.ajax({
					type: "get",
					url: url6,
					dataType: "text",
					async : false,
					cache:false,
					timeout:3000,						
					success: function(data) {
						//alert(data)
						//alert(JSON.stringify(data))
						res6 = data;				
					}
				});
								
				//北向资金
				var res7 = "";
				var wzpj = "";
				$.ajax({
					type: "get",
					url: url7,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,						
					success: function(data) {						
						//alert(JSON.stringify(data))
						// console.log(JSON.stringify(data));
						res7 = data.info.trend;
						wzpj = data.info.sign;						
					}
				});
				var arr7 = [];					
				for (var i = 0; i < res7.length; i++) {					
					arr7.push({"time":res7[i][0],"沪股通":res7[i][1],"深股通":res7[i][2],"合计":res7[i][3]})
				}
				//document.write(JSON.stringify(arr7));
				
				var data1 = res1;
				var transform_aa1 = [           
				{"tag":"ul id=f7", children:function(){return(json2html.transform(this.info, transform_bb1));}}
				];
				
				var transform_bb1= 				
				{"tag":"p", children:[
				{"tag": "p","html":"综合强度：<font id=f11>${strong}</font>"},				
				//{"tag": "p","html":"盘面点评：<font id=f11>${sign}</font>"},																		 						
				]};
				
				var html1 = json2html.transform(data1, transform_aa1);
				div.innerHTML += html1;
				
				var obj1 = document.createElement("div");
				obj1.id = "chart1";	
				obj1.style.position= "relative";
				obj1.style.margin= "-15px 0px -30px -20px"; 
				obj1.style.width= "280px";
				obj1.style.height= "200px";					
				div.appendChild(obj1);
				
				var data2 = res2;
				//document.write(data2)
				if(k == 0){
					tt = data2.match(/"date":"(\S*)","time"/)[1];						
					dt = tt;
				}
				var transform_aa2 = [           
				{"tag":"ul id=f8", children:function(){return(json2html.transform(this.info, transform_bb2));}}
				];
				
				var transform_bb2= 				
				{"tag":"p", children:[
				{"tag": "p","html":"涨跌统计："},
				{"tag": "p","html":"实际涨停：<font id=f11>${SJZT}</font><font id=f8>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;实际跌停：</font><font id=f11>${SJDT}</font>"},								
				{"tag": "p","html":"上涨家数：<font id=f11>${SZJS}</font><font id=f8>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下跌家数：</font><font id=f11>${XDJS}</font>"},												
				]};
				
				var arr3 = [];
				var d3 = JSON.parse(res3);					
				arr3.push({"1b":d3.info[0],"eb":d3.info[1],"sb":d3.info[2],"gg":d3.info[3],"ep":d3.info[4],"sp":d3.info[5],"gp":d3.info[6],
				"ztp":d3.info[7],"zztj":d3.info[8],"zlbj":d3.info[9],"zpbj":d3.info[10],"bx":d3.info[11]});					
				var data3 = '{"info":' + JSON.stringify(arr3) + "}";
				//document.write(data3);
				var transform_aa3 = [           
				{"tag":"ul id=f9", children:function(){return(json2html.transform(this.info, transform_bb3));}}
				];
				
				var transform_bb3= 				
				{"tag":"p", children:[
				{"tag": "p","html":"涨停股表现：<font id=f11>${bx}</font>"},
				{"tag": "p","html":"一板：<font id=f11>${1b}家</font>"},					
				{"tag": "p", "html": function(){
					var pbl = this.ep;
					pbl = keepTwoDecimal(pbl);						
					return('二板：<font id=f11>' + this.eb + '家(连板率：' + pbl + "%)</font>");					
				}},
				{"tag": "p", "html": function(){
					var pbl = this.sp;
					pbl = keepTwoDecimal(pbl);						
					return('三板：<font id=f11>' + this.sb + '家(连板率：' + pbl + "%)</font>");					
				}},
				{"tag": "p", "html": function(){
					var pbl = this.gp;
					pbl = keepTwoDecimal(pbl);						
					return('更高：<font id=f11>' + this.gg + '家(连板率：' + pbl + "%)</font>");					
				}},					
				{"tag":"ul id=f10", children:[
				{"tag": "p", "html": function(){
					var pbl = this.ztp;
					pbl = keepTwoDecimal(pbl);						
					return('今日涨停破板率：<font id=f11>' + pbl + "%</font>");					
				}},
				{"tag": "p", "html": function(){
					var bl = this.zztj;
					bl = keepTwoDecimal(bl);						
					return('昨日涨停今日表现：<font id=f11>' + bl + "%</font>");					
				}},
				{"tag": "p", "html": function(){
					var bl = this.zlbj;
					bl = keepTwoDecimal(bl);						
					return('昨日连板今日表现：<font id=f11>' + bl + "%</font>");					
				}},
				{"tag": "p", "html": function(){
					var bl = this.zpbj;
					bl = keepTwoDecimal(bl);						
					return('昨日破板今日表现：<font id=f11>' + bl + "%</font>");					
				}},
				]}]};
									
				var html2 = json2html.transform(data2, transform_aa2);
				var html3 = json2html.transform(data3, transform_aa3);
				
				
				var data5 = res5;
				var zrzl = data5.match(/"s_zrtj":"(\S*)/)[1].split('"')[0];  //昨日总量
				data5 = data5.match(/\[\[(\S*)\]\]/)[1];
				//document.write(data5);
				
				var dd = data5.split('],[')
				var aa = dd[dd.length - 1].replace(/"/g,"");
				var jrxl = aa.split(',')[1];  //今日现量
				var zrxl = aa.split(',')[2];  //昨日现量
				var bfb = (jrxl / zrxl - 1) * 100;
				if(bfb >= 0){
					bfb = '<font color=#FF1493>（+' + keepTwoDecimal(bfb) + '%）</font>';
				}else{
					bfb = '<font color=#98FB98>（' + keepTwoDecimal(bfb) + '%）</font>';
				}					
				var ycl = (jrxl / zrxl) * zrzl;
				//alert(ycl);
				var amount = '<ul id=f9 style="margin:-10px 0px -5px -10px;">量能：</ul>' +
				'<font id=f12 style="margin-left:-5px;">实际：</font><font id=f11>' + NumberTrans(jrxl) + '</font>'+
				'<font id=f12>预测：</font><font id=f11>' + NumberTrans(ycl) +'</font>' + bfb +
				'<br><font id=f12 style="margin-left:-5px;">昨日：</font><font id=f11>' + NumberTrans(zrzl) + '</font>';	
				//div = document.getElementById('towrite');														
				div.innerHTML += html2 + amount + html3;	
				
				var data41 = res41;
				var data42 = res42;
				
				var obj = document.createElement("div");
				obj.id = "chart";
				//obj.style.border= "1px solid #555555";
				//obj.className = "fixedBox";
				//obj.style.position= "relative"; 
				obj.style.float= "left"; 
				obj.style.marginLeft= "-18px"; 
				obj.style.marginTop= "-20px"; 
				obj.style.width= "300px";
				obj.style.height= "400px";					
				obj.style.fontSize="12px";	
				div.appendChild(obj);
				
				<!-- var obj1 = document.createElement("div"); -->
				<!-- obj1.id = "chart1";	 -->
				<!-- obj1.style.position= "relative"; -->
				<!-- obj1.style.float= "left";  -->
				<!-- obj1.style.left= "-10px"; 					 -->
				<!-- obj1.style.width= "280px"; -->
				<!-- obj1.style.height= "200px";					 -->
				<!-- obj.appendChild(obj1); -->
				
				var obj2 = document.createElement("div");
				obj2.id = "title";	
				obj2.style.position= "relative";
				obj2.style.float= "left"; 
				obj2.style.left= "-10px"; 					
				obj2.style.width= "280px";
				obj2.style.height= "20px";					
				obj.appendChild(obj2);
				
				var obj3 = document.createElement("div");
				obj3.id = "chart2";	
				obj3.style.position= "relative";
				obj3.style.float= "left"; 
				obj3.style.left= "-10px"; 					
				obj3.style.width= "280px";
				obj3.style.height= "160px";
				obj3.style.marginTop= "-32px"; 					
				obj.appendChild(obj3);
				
				var obj4 = document.createElement("div");				
				obj4.id = "chart3";	
				obj4.style.position= "relative";
				obj4.style.float= "left"; 
				obj4.style.left= "-10px"; 					
				obj4.style.width= "280px";
				obj4.style.height= "200px";
				obj4.style.marginTop= "20px"; 					
				obj.appendChild(obj4);
								
				var data4 = data41.match(/{"info":(\S*)}\],"tip"/)[1]+"},{";
				data4 += data42.match(/{"info":\[{(\S*),"tip"/)[1];
				//document.write(data4);
				var arr1 = JSON.parse(data4);
				function up1(a,b){
					var aa = a.Day.replace(/-/g,"");
					var bb = b.Day.replace(/-/g,"");
					return aa - bb					
				}
				arr1.sort(up1);					
				GetChart1(arr1);
				
				var a1 = data2.match(/"date":"(\S*)","time"/)[1]
				var a2 = data2.match(/"qscln":(\S*),"s_zrcs"/)[1]
				vol = a1 + "：" + NumberTransform1(a2);
				div2 = document.getElementById('title');														
				div2.innerHTML = '<font size="2" style="color:#FFF0F5;position:absolute; right:5px;">' + vol + '</font>';	
				
				//var data6 = xmlHttp6.responseText;
				var data6 = res6;
				data6 = data6.match(/{"info":\[{(\S*),"ttag":/)[1]					
				if(data6.indexOf(dt) > -1){
					data6 = "[{" + data6;
				}else{
					data6 = '[{"lastPoint":"' + a2 + '","Date":"' + a1 + '"},{' + data6;
				}
				//document.write(data6);
				var arr2 = JSON.parse(data6);
				function up2(a,b){
					var aa = a.Date.replace(/-/g,"");
					var bb = b.Date.replace(/-/g,"");
					return aa - bb					
				}
				arr2.sort(up2);
				//arr = JSON.stringify( arr );	
				//document.write(arr);
				//var arr = JSON.parse(result);					
				GetChart2(arr2);
				GetChart7(arr7,wzpj);
			//}	
				document.getElementById("PriceDate").value = tt;				
			}
			
			function getParamValues(name, arr) {
				var ret = []
				var len = arr.length;
				if(len < 241){
				 len = 241
				}						
				for (var i = 0; i < len; i++) {
					if(arr[i] != undefined){
						ret.push(arr[i][name])
					}else{
						ret.push(null)
					}
				}				
				return ret
			}
			
			function getParamValues1(name, arr) {
				var ret = []
				for (var i = 0, len = arr.length; i < len; i++) {
					ret.push(arr[i][name])
				}
				return ret
			}
			
			function getParamValues2(name, arr) {
				var ret = []
				//for (var i = 0, len = arr.length; i < len; i++) {
				for (var i = arr.length - 30, len = arr.length; i < len; i++) {
					ret.push(arr[i][name])
				}
				return ret
			}
			
			function NumberTransform(num) { 
				var result = num;
				if(Math.abs(num) > 100000000){
					result = num / 100000000;
					result = result.toFixed(2) + "亿";
				}else if(Math.abs(num) > 10000){
					result = num/10000;
					result = result.toFixed(2) + "万";
				}				   
				return result;  
			};	
			
			function NumberTransform1(num) { 
				var result = num;				
				result = num/10000;
				result = result.toFixed(0) + "亿";								  
				return result;  
			};	
		</script>
		<script>
			function GetChart1(arr) {				
				var myChart = echarts.init(document.getElementById('chart1'));
				
				var option = {
					title:{
						 left:'left',
						text: '市场情绪',
						textStyle:{ //设置主标题风格
							color:'#FFFF00',//设置主标题字体颜色
							fontStyle:'normal',//主标题文字风格
							fontSize: 12
						}
					},
					tooltip: {   //提示框
						trigger: 'axis',
						<!-- backgroundColor: "#2D8CF0", //设置背景颜色 -->
						<!-- textStyle: { -->
						  <!-- color: "#000" //设置文字颜色 -->
						<!-- }, -->
						<!-- borderColor: "#2D8CF0", //设置边框颜色 -->
						axisPointer: {
							type: 'cross',
							label: {
								backgroundColor: '#000'
							},
							crossStyle: {								
								textStyle:{ 
									color: '#fff'									
								}
							},							 
						},	
						formatter(params) {  //添加文字						
							var str = params[0].name + '<br />'						  
							params.forEach(item => {																							
								str += '<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:' + item.color + '"></span>' + item.seriesName + " : " + item.data + "<br />";
							})
							return str;							
						}
					},					
					grid: { // 边距
					  left: '10%',
					  right: '5%',
					  bottom: '25%',
					  top: '12%',
					  //containLabel: true  //grid 区域是否包含坐标轴的刻度标签
					},
	
					xAxis: [		//x轴设置		  
						{
							type: 'category',								
							data: getParamValues1('Day', arr),
							axisLine:{  //x轴坐标线设置
								lineStyle:{
									color:"#D3D3D3",  //x轴坐标线颜色
									width: 2   // 坐标轴线宽
								}
							},
							axisTick: {   //x轴刻度
								show:false, 
							},
							axisLabel:{	 //x轴标签设置						
								//rotate:45，//倾斜45°
								formatter:function(value){   //文字竖直显示
									//return value.split("2022").join("\n");
									value = value.replace(/-/g,'');
									return value.substr(0,4) + "\n" + value.substr(4,4);
								}, 
								textStyle:{  //x轴文字
									color:"#FFF"
								}
							},
							axisPointer: {
								type: 'shadow',								
							}
						}
					],

					yAxis: [  //y轴
						{
							type: 'value',
							min: function(value) {//取最小值向下取整为最小刻度									
								return Math.floor(value.min)
							},
							max: function(value) {//取最大值向上取整为最大刻度
								if(value.max < 0){
									return  0 
								}else{
									return  Math.ceil(value.max) 
								}									
							},
							interval: function (value) { // 刻度间隔
								if(value.max < 0){
									return  Math.ceil(value.min) 
								}else{
									return  Math.ceil(value.max)
								}									
							},								
							splitLine:{ //y轴网格线									
								show:true,
								lineStyle: { 									
									color: '#D3D3D3', 
									width: 1,    
									type: 'dotted', //（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
								} 
							},
							axisLine: { //y轴坐标线设置
								show: true, 									
								lineStyle: { 									
									color: '#D3D3D3', //y轴颜色
									width: 2,    // 坐标轴线宽
									type: 'solid',     // 坐标轴线线的类型（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
								} 
							},
							axisTick: {   //y轴刻度
								show:false, 
							},
							axisLabel: {  //y轴标签设置
								show: true,
								color: '#fff',									
								formatter: function (value){
									if(value != 0){							  
										return value
									}else{
										return 0
									}
								}
							}
						},
					],
					
					series: [						
						{
							name: '综合强度',
							data: getParamValues1('strong', arr),
							type: 'line',								
							//symbol: 'circle',//拐点样式
							//symbolSize: 18,//拐点大小
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 2,//折线宽度
								  color: "#FFA500"//折线颜色
								},
								color: '#FFA500',//拐点颜色
								borderColor: '#FFA500',//拐点边框颜色
								borderWidth: 1//拐点边框大小
							  },
							  emphasis: {
								color: '#FFA500'//hover拐点颜色定义
							  }
							},
						}
					]
				}					
				myChart.setOption(option);
			}
		</script>
		<script>
			function GetChart2(arr) {
				var myChart = echarts.init(document.getElementById('chart2'));				
				var option = {
					title:{
						left:'left',						
						text: '市场量能',
						textStyle:{ //设置主标题风格
							color:'#FFFF00',//设置主标题字体颜色
							fontStyle:'normal',//主标题文字风格
							fontSize: 12
						}
					},					
					tooltip: {   //提示框
						trigger: 'axis',						
						axisPointer: {
							type: 'cross',
							label: {
								formatter: function (params) {
								//alert(params.value)
									if(params.value.toString().indexOf("-") > -1){
										return params.value
									}else if(params.value != "null"){
										return NumberTransform1(params.value)
									}
								},
								backgroundColor: '#000'
							},
							crossStyle: {								
								textStyle:{ 
									color: '#fff'									
								}
							},							 
						},
						formatter(params) {  //添加文字						
							var str = params[0].name + '<br />'						  
							params.forEach(item => {																							
								str += '<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:' + item.color + '"></span>' + item.seriesName + " : " + NumberTransform1(item.data) + "<br />";
							})
							return str;							
						}
					},					
					grid: { // 边距
					  left: '10%',
					  right: '5%',
					  bottom: '12%',
					  top: '12%',					  
					},					
					xAxis: [		//x轴设置		  
						{
							type: 'category',								
							data: getParamValues2('Date', arr),							
							axisLine:{  //x轴坐标线设置
								lineStyle:{
									type: 'dotted',   //坐标轴虚线（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
									color:"#D3D3D3",  //x轴坐标线颜色
									//width: 2   // 坐标轴线宽
								}
							},
							axisTick: {   //x轴刻度
								show:false, 
							},
							axisLabel:{	 //x轴标签设置	
								interval: 6,
								formatter: function (value, index) {
								//alert(value)
									 //if(value=="09:31" || value=="10:30" || value=="11:30" || value=="14:00" || value=="15:00"){
										var aa = value.split("-");
										return aa[1] + "-" + aa[2];
									 //}
								 },
								textStyle:{  //x轴文字
									color:"#FFF"
								}
							},
							axisPointer: {
								type: 'shadow',								
							}
						}
					],

					yAxis: [  //y轴
						{
							type: 'value',							
							interval: 50000000,					
							splitLine:{ //y轴网格线									
								show:true,
								lineStyle: { 								
									color: '#D3D3D3', 
									width: 1,    
									type: 'dotted', //（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
								} 
							},
							axisLine: { //y轴坐标线设置
								show: true, 									
								lineStyle: { 									
									color: '#D3D3D3', //y轴颜色
									//width: 2,    // 坐标轴线宽
									type: 'solid',     // 坐标轴线线的类型（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
								} 
							},
							axisTick: {   //y轴刻度
								show:false, 
							},
							axisLabel: {  //y轴标签设置
								show: true,
								color: '#fff',									
								formatter: function (value,i){
								
									if (i === 1) {
										value = '5K';
										return value
									}
									if (i === 2) {
										value = '10K';
										return value
									}								
								}
							}
						},
					],										
					series: [
						{
							name: '沪深量能',
							type: 'bar',
							barGap: 0,							
							barWidth: 5, // 柱图宽度							
							itemStyle:{
								normal: {								
									color: '#FFC0CB',									
								}
							},
							data: getParamValues2('lastPoint', arr)
						}
					]
				}					
				myChart.setOption(option);
			}
		</script>
		<script>
			function GetChart7(arr,ss) {				
				//过滤null
				var values = arr.map(function(o){
					var aa = o.合计;
					if(aa == Infinity){
						aa = 0;
					}
					return aa;
				}).filter(function(val) {								
					return val !== null
				});
				
				var maxa = Math.max(...values);
				maxa = Math.max(maxa,0);
				
				var mina = Math.min(...values);
				mina = Math.min(mina,0);
				
				var _interval = keepTwoDecimal((maxa - mina) / 3);
				var myChart = echarts.init(document.getElementById("chart3"));				
				var option = {
					title:{
						left:'left',						
						text: '北向资金：' + ss,
						textStyle:{ //设置主标题风格							
							color:'#FFFF00',//设置主标题字体颜色
							fontStyle:'normal',//主标题文字风格
							fontSize: 14
						}
					},
					tooltip: {   //提示框
						trigger: 'axis',						
						axisPointer: {  //十字线的横向线
							type: 'cross',							
							label: {
								show:false
							}														
						},							
						formatter(params) {  //添加文字
							if(params[0].name != "null"){
								var str = params[0].name + '<br />'						  
								params.forEach(item => {																							
									str += '<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:' + item.color + '"></span>' + item.seriesName + " : " + NumberTransform(item.data) + "<br />";
								})
								return str;	
							}
						}
					},
					legend: [    // 图例
						{
							show : true,
							left: 'right',
							top: 20, 
							data: ['合计', '沪股通', '深股通'],
							selected: {'合计':true, '沪股通':false, '深股通':false},
							icon: "rect", //circle，rect, line，roundRect，triangle，diamond，pin，arrow，none
							align: "auto", // 图例标记和文本的对齐
							itemGap: 20, // 图例每项之间的间隔。
							itemWidth: 15,     // 图例标记的图形宽度
							itemHeight: 3,      // 图例标记的图形高度// 使用字符串模板，模板变量为图例名称 {name}							
							textStyle: {
								color: "#fff", // 文字的颜色。								
							}
						}						
					],
					grid: { // 边距
					  left: '20%',
					  right: '5%',
					  bottom: '15%',
					  top: '20%',
					},
	
					xAxis: [		//x轴设置		  
						{
							type: 'category',								
							data: getParamValues('time', arr),							
							axisLine:{  //x轴坐标线设置
								lineStyle:{
									color:"#60AFFF",  //x轴坐标线颜色
									width: 1   // 坐标轴线宽
								}
							},
							axisTick: {   //x轴刻度
								show:false, 
							},
							axisLabel:{	 //x轴标签设置	
								interval: 0,
								formatter: function (value, index) {
									//alert(value)								
									 if(value == "09:30" || value == "11:30" || value == "15:00"){
										return value;
									 }
								 },
								textStyle:{  //x轴文字
									color:"#FFF"
								}
							}							
						}
					],
					yAxis: [  //y轴
						{
							type: 'value',
							min: mina,
							max: maxa,
							interval: _interval,		
							splitLine:{ //y轴网格线									
								show:true,
								lineStyle: { 									
									color: '#828282', 
									width: 1,    
									type: 'dotted', //（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
								} 
							},
							axisLine: { //y轴坐标线设置
								show: true, 									
								lineStyle: { 									
									color: '#D3D3D3', //y轴颜色
									width: 1,    // 坐标轴线宽
									type: 'solid',     // 坐标轴线线的类型（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
								} 
							},
							axisTick: {   //y轴刻度
								show:true, 
							},
							axisLabel: {  //y轴标签设置
								show: true,
								color: '#fff',									
								formatter: function (value){									
									return NumberTransform(value);
								}
							}
						}
					],					
					series: [						
						{							
							name: '合计',
							data: getParamValues('合计', arr),							
							type: 'line',								
							symbol: 'circle',//拐点样式‘circle’, ‘rect’, ‘roundRect’, ‘triangle’, ‘diamond’, ‘pin’, ‘arrow’ 
							symbolSize: 0,//拐点大小							
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 1,//折线宽度
								  color: "#FF0000"//折线颜色
								},
								color: '#FF0000',//拐点颜色								
							  }							  
							}							
						},
						{							
							name: '沪股通',
							data: getParamValues('沪股通', arr),							
							type: 'line',								
							symbol: 'circle',//拐点样式‘circle’, ‘rect’, ‘roundRect’, ‘triangle’, ‘diamond’, ‘pin’, ‘arrow’ 
							symbolSize: 0,//拐点大小							
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 1,//折线宽度
								  color: "#FFC286"//折线颜色
								},
								color: '#FFC286',//拐点颜色								
							  }							  
							}							
						},
						{							
							name: '深股通',
							data: getParamValues('深股通', arr),							
							type: 'line',								
							symbol: 'circle',//拐点样式‘circle’, ‘rect’, ‘roundRect’, ‘triangle’, ‘diamond’, ‘pin’, ‘arrow’ 
							symbolSize: 0,//拐点大小							
							itemStyle: {
							  normal: {
								lineStyle: {
								  width: 1,//折线宽度
								  color: "#8080FF"//折线颜色
								},
								color: '#8080FF',//拐点颜色								
							  }							  
							}							
						}
					]
				}					
				myChart.setOption(option);
			}			
		</script>
	</body>
</html>